<cfset snips = viewState.getValue("snips") />
<cfset userID = viewState.getValue("userid") />
<h2>
Snip List
</h2>

<cfoutput>
<table width="100%" cellspacing="0" cellpadding="" border="0">
	<thead >
		<tr>
			<th>Name</th>
			<th>Description</th>
			<th>Author</th>
			<th>Platforms</th>
			<th>Actions</th>
		</tr>
	</thead>
	<tbody>
		<cfset tempLibID = 0 />
		<cfset tempSnipID = 0 />
		<cfloop query="snips">
		<cfif tempLibID is not libID>
		<tr>
			<td colspan="5">
			#libName#
			</td>
		</tr>
			<cfset tempLibID = libID />
		</cfif>
		<cfif tempSnipID  is not snipID and snipid is not ''>
		<tr>
			<td>#snipName#</td>
			<td>#snipDescription#</td>
			<td>#Author#</td>
			<td>#Platforms#</td>
			<td>
				<a href="#viewState.getValue("mySelf")#showSnipEntryForm&snipid=#snipid#<cfif userid is not ''>&userid=#userid#</cfif>">Edit</a>
				&nbsp;|&nbsp;
				<a href="#viewState.getValue("mySelf")#deleteSnip&snipID=#snipid#">Delete</a>
			</td>
		</tr>
			<cfset tempSnipID = snipID />
		</cfif>
		</cfloop>
		<tfoot>
			<td align="right" colspan="6"><a href="#viewState.getValue("mySelf")#showSnipEntryForm<cfif userid is not ''>&userid=#userid#</cfif>">Add Snip</a></td>
		</tfoot>
	</tbody>
</table>
</cfoutput>